<!DOCTYPE html>
<html lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <!-- Meta, title, CSS, favicons, etc. -->
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <title>禁毒清源系统</title>

    <!-- Bootstrap -->
    <link href="/resources/gentelella/vendors/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet"  >
    <!-- Font Awesome -->
    <link href="/resources/gentelella/vendors/font-awesome/css/font-awesome.min.css" rel="stylesheet"  >
    <!-- NProgress -->
    <link href="/resources/gentelella/vendors/nprogress/nprogress.css" rel="stylesheet"  >
    <!-- iCheck -->
    <link href="/resources/gentelella/vendors/iCheck/skins/flat/green.css" rel="stylesheet"  >

    <!-- bootstrap-progressbar -->
    <link href="/resources/gentelella/vendors/bootstrap-progressbar/css/bootstrap-progressbar-3.3.4.min.css" rel="stylesheet"  >
    <!-- JQVMap -->
    <link href="/resources/gentelella/vendors/jqvmap/dist/jqvmap.min.css" rel="stylesheet"   />
    <!-- bootstrap-daterangepicker -->
    <link href="/resources/gentelella/vendors/bootstrap-daterangepicker/daterangepicker.css" rel="stylesheet"  >

    <!-- Custom Theme Style -->
    <link href="/resources/gentelella/css/custom.min.css" rel="stylesheet"  >
    <link href="/resources/css/index.css?r=1" rel="stylesheet"  >
    <script src="/resources/js/jquery-1.11.1.min.js"></script>
    <script src="/resources/js/data.js"></script>
    <script src="/resources/js/self.js"></script>

    <script type="text/javascript" src="/resources/js/echarts.min.js"></script>
    <style>
        input[type="checkbox"]{
            width: 20px !important;
            height: 20px  !important;
        }
        input[type="radio"] {
            width: 20px !important;
            height: 20px !important;
        }

        th{
            white-space:nowrap;
        }
        table.table-bordered.dataTable tbody th, table.table-bordered.dataTable tbody td{
            white-space: nowrap;
            　　overflow:hidden;
            　　text-overflow:ellipsis;
            word-break:break-all;

        }
        .serial{
            width: 30px !important;
        }
        td{
            max-width: 200px;
            overflow:hidden;
            text-overflow: ellipsis;
            word-break: break-all;
            white-space: nowrap;
        }
    </style>
    <script src="/resources/gentelella/vendors/bootstrap/js/modal.js"></script>
</head>

<body class="nav-md" style="background-color: #F7F7F7;">
<div class="container body">
    <div class="main_container">
        <div class="col-md-3 left_col">
            <div class="left_col scroll-view">
                <div class="navbar nav_title" style="border: 0;">
                    <a href="index.html" class="site_title" ><!--<i class="fa fa-paw"></i> <span></span>-->
                        <img src="/resources/images/jdbz.png" style="height: 40px;width: 40px"/>
                        <span style="padding-left: 5px">禁毒清源系统</span>
                    </a>
                </div>

                <div class="clearfix"></div>

                <!--  &lt;!&ndash; menu profile quick info &ndash;&gt;
                  <div class="profile clearfix">
                      <div class="profile_pic">
                          <img src="images/img.jpg" alt="..." class="img-circle profile_img">
                      </div>
                      <div class="profile_info">
                          <span>Welcome,</span>
                          <h2>John Doe</h2>
                      </div>
                  </div>-->
                <!-- /menu profile quick info -->

                <br />

                <!-- sidebar menu -->
                <div id="sidebar-menu" class="main_menu_side hidden-print main_menu">
                    <div class="menu_section">
                        <h3></h3>
                        <ul class="nav side-menu">
                            <li class="active">
                                <a><i class="fa fa-home"></i> 企业检查 <span class="fa fa-chevron-down"></span></a>
                                <ul class="nav child_menu"  style="display: block;">
                                    <li><a class="nav-a" data-href="police_check_list.html">企业检查</a></li>

                                </ul>
                            </li>
                            <li>
                                <a><i class="fa fa-home"></i> 企业注册 <span class="fa fa-chevron-down"></span></a>
                                <ul class="nav child_menu">
                                    <li><a class="nav-a" data-href="company_r_list.html">生产企业</a></li>
                                    <li><a class="nav-a" data-href="trans_r_list.html">运输企业</a></li>
                                    <li><a class="nav-a" data-href="buy_r_list.html">采购企业</a></li>
                                </ul>
                            </li>
                            <li ><a><i class="fa fa-home"></i> 基本信息 <span class="fa fa-chevron-down"></span></a>
                                <ul class="nav child_menu">
                                    <li><a class="nav-a" data-href="company_list.html">企业信息</a></li>
                                    <li><a class="nav-a" data-href="trans_list.html">运输企业</a></li>
                                    <li><a class="nav-a" data-href="buy_list.html">采购企业</a></li>
                                    <li><a class="nav-a" data-href="material_list.html">原材料采购</a></li>
                                    <li><a class="nav-a" data-href="m_product_list.html">产品</a></li>
                                    <!--<li><a class="nav-a" data-href="device_list.html">计量设备</a></li>-->

                                </ul>
                            </li>

                            <li><a><i class="fa fa-flask"></i>采购单 <span class="fa fa-chevron-down"></span></a>
                                <ul class="nav child_menu">
                                    <li><a class="nav-a" bind-data='{"process":"create"}'
                                           data-href="supplier_order_list.html">原料采购</a></li>
                                    <li><a class="nav-a"   data-href="supplier_into_warehouse_list.html">入库</a></li>
                                    <li><a class="nav-a"   data-href="supplier_out_warehouse_list.html">出库</a></li>

                                </ul>
                            </li>
                            <li><a><i class="fa fa-truck"></i>销售记录 <span class="fa fa-chevron-down"></span></a>
                                <ul class="nav child_menu">

                                    <li><a class="nav-a" bind-data='{"process":"create"}'
                                           data-href="sale_order_list.html">新单待处理</a></li>
                                    <li><a class="nav-a" bind-data='{"process":"comment"}'
                                           data-href="sale_order_list.html">反馈待处理</a></li>
                                    <li><a class="nav-a" bind-data='{"process":"auditSuccess"}'
                                           data-href="sale_order_list.html">完结</a></li>
                                    <li><a class="nav-a" bind-data='{"process":"","refuseFlag":"1"}'
                                           data-href="sale_order_list.html">重审订单</a></li>
                                    <li><a class="nav-a" bind-data='{"process":""}'
                                           data-href="sale_order_list.html">全部销售记录</a></li>
                                    <li><a class="nav-a"
                                           data-href="offset_order_list.html">对冲单</a></li>
                                </ul>
                            </li>
                            <li ><a><i class="fa fa-home"></i> 软件设置 <span class="fa fa-chevron-down"></span></a>
                                <ul class="nav child_menu" >
                                    <li><a class="nav-a" data-href="company_list_m.html">基础配置</a></li>

                                </ul>
                            </li>
                            <li><a><i class="fa fa-bar-chart-o"></i>查询统计 <span class="fa fa-chevron-down"></span></a>
                                <ul class="nav child_menu">
                                    <li><a class="nav-a"
                                           data-href="statisticsV3.html">统计销售量</a></li>
                                    <!--<li><a class="nav-a"
                                           data-href="statisticsV3_2.html">采集统计</a></li>-->
                                </ul>
                            </li>
                            <li><a><i class="fa fa-gear"></i>用户管理 <span class="fa fa-chevron-down"></span></a>
                                <ul class="nav child_menu">
                                    <li><a class="nav-a"  data-href="password_edit.html">修改密码</a></li>
                                    <li><a class="nav-a"  onclick="logoOut()">退出</a></li>
                                </ul>
                            </li>
                        </ul>
                    </div>

                </div>

            </div>
        </div>

        <!-- top navigation -->
        <div class="top_nav">
            <div class="nav_menu">
                <nav>
                    <div class="nav toggle" style="width:500px !important;">
                        <span class="index-title" style="display: block;width:80%;min-height:35px;margin-left: 20px"></span>
                    </div>


                </nav>
                <ul class="nav navbar-nav navbar-right" style="width:55%;">
                    <li class="">
                        <a href="javascript:;" class="user-profile dropdown-toggle"
                           data-toggle="dropdown" aria-expanded="false" id="account">
                            用户
                            <!--<span class=" fa fa-angle-down"></span>-->
                        </a>
                        <!--<ul class="dropdown-menu dropdown-usermenu pull-right">-->
                        <!--<li><a href="javascript:void(0);"onclick="updatePassword()" > 修改密码</a></li>-->
                        <!--<li><a  onclick="logoOut()"><i class="fa fa-sign-out pull-right"></i> 退出</a></li>-->
                        <!--</ul>-->
                    </li>

                </ul>
            </div>
        </div>
        <!-- /top navigation -->

        <!-- page content -->
        <div class="right_col" role="main" >
            <!--           <div style="width:100%;height: 100%;background: url('/resources/images/bg.gif');
                     background-size: contain;background-repeat: no-repeat">

                       </div>-->
            <div style="height: 45px;"></div>

            <!--<div style="height:50%;">-->
                <!--<div style="height:300px;width: 49%;float: left;-->
                <!--background-image: url('/resources/images/jkt.jpg');background-size: contain;-->
                <!--background-repeat: no-repeat" >-->

                <!--</div>-->
                <!--<div style="height:300px;width: 49%;float: right;-->
                <!--background-image: url('/resources/images/gcfb.jpg');background-size: contain;-->
                <!--background-repeat: no-repeat" >-->

                <!--</div>-->
            <!--</div>-->
            <div style="height:50%;">
                <div style="width: 100%;float: left;padding: 2px">
                    <div id="supplierOrder" style="float: left;height:250px;width: 49%;background:#fff;">

                    </div>

                    <div id="saleOrder" style="float: right;height:250px;width: 49%;background:#fff;">

                    </div>
                </div>
                <div style="width: 100%;float: right;height:250px;">
                    <div id="companyPie" style="height:250px;width: 99%;background:#fff;">

                    </div>
                </div>
            </div>


        </div>
        <!-- /page content -->

        <!-- /footer content -->
    </div>
</div>

<!-- jQuery -->
<script src="/resources/gentelella/vendors/jquery/dist/jquery.min.js"></script>
<!-- Bootstrap -->
<script src="/resources/gentelella/vendors/bootstrap/dist/js/bootstrap.min.js"></script>
<!-- FastClick -->
<script src="/resources/gentelella/vendors/fastclick/lib/fastclick.js"></script>
<!-- NProgress -->
<script src="/resources/gentelella/vendors/nprogress/nprogress.js"></script>
<!-- Chart.js -->
<script src="/resources/gentelella/vendors/Chart.js/dist/Chart.min.js"></script>
<!-- gauge.js -->
<script src="/resources/gentelella/vendors/gauge.js/dist/gauge.min.js"></script>
<!-- bootstrap-progressbar -->
<script src="/resources/gentelella/vendors/bootstrap-progressbar/bootstrap-progressbar.min.js"></script>
<!-- iCheck -->
<script src="/resources/gentelella/vendors/iCheck/icheck.min.js"></script>
<!-- Skycons -->
<script src="/resources/gentelella/vendors/skycons/skycons.js"></script>
<!-- Flot -->
<script src="/resources/gentelella/vendors/Flot/jquery.flot.js"></script>
<script src="/resources/gentelella/vendors/Flot/jquery.flot.pie.js"></script>
<script src="/resources/gentelella/vendors/Flot/jquery.flot.time.js"></script>
<script src="/resources/gentelella/vendors/Flot/jquery.flot.stack.js"></script>
<script src="/resources/gentelella/vendors/Flot/jquery.flot.resize.js"></script>
<!-- Flot plugins -->
<script src="/resources/gentelella/vendors/flot.orderbars/js/jquery.flot.orderBars.js"></script>
<script src="/resources/gentelella/vendors/flot-spline/js/jquery.flot.spline.min.js"></script>
<script src="/resources/gentelella/vendors/flot.curvedlines/curvedLines.js"></script>
<!-- DateJS -->
<script src="/resources/gentelella/vendors/DateJS/build/date.js"></script>
<!-- JQVMap -->
<script src="/resources/gentelella/vendors/jqvmap/dist/jquery.vmap.js"></script>
<script src="/resources/gentelella/vendors/jqvmap/dist/maps/jquery.vmap.world.js"></script>
<script src="/resources/gentelella/vendors/jqvmap/examples/js/jquery.vmap.sampledata.js"></script>
<!-- bootstrap-daterangepicker -->
<script src="/resources/gentelella/vendors/moment/min/moment.min.js"></script>
<script src="/resources/gentelella/vendors/bootstrap-daterangepicker/daterangepicker.js"></script>
<script type="text/javascript" src="http://api.tianditu.gov.cn/api?v=4.0&tk=611c56de6afcba460edbcbbbd3009445"></script>
<script type="text/javascript" src="http://lbs.tianditu.gov.cn/api/js4.0/opensource/openlibrary/ImageOverlay.js"></script>
tianditu
<!-- Custom Theme Scripts -->
<script src="/resources/gentelella/js/custom.js"></script>

</body>
<script type="text/javascript">
    $(function () {
        //获取登录账号
        $.ajax({
            url:'/admin/queryFind.do',
            dataType:"json",
            success:function(ret){
                if(ret.success){
                    $("#account").html(ret.data.name)
                }
            }
        });

        $(".menu_section  a.nav-a").click(function () {
            $("li").removeClass("active");
            $(this).parent("li").addClass("active");
            var href = $(this).attr("data-href");
            var data =  $(this).attr("bind-data");
            if(isNullOrUndefined(data)){
                goto(href);
            }else {
                goto(href,JSON.parse(data));
            }

        });
        statisticsSupplierOrders();
        statisticsSaleOrders();
        companyPieStatistics();
    });
    function logoOut() {
        $.ajax({
            url:'/admin/logout.do',
            type:'post',
            success:function(data){
                if(data.success){
                    window.location.href = "/html/security/login.html?r="+new Date().getTime();
                }else{
                    alert(data.msg);
                }
            },
            error:function () {
                alert("系统错误！");
            }
        });
    }
    function updatePassword() {
        goto("password_edit.html",{});
    }
    function setTitle(titleName) {
        $(".index-title").html(titleName);
    }

    function statisticsSupplierOrders() {

        $.ajax({
            url:"/admin/statistics/statisticsSupplierOrders.do",
            data:{},
            dataType:'json',
            type:'post',
            success:function(data){

                if(data.success){
                    var   xAxis = data.data.xAxis;
                    var  legendList = data.data.legendList;
                    var baseStatistics = data.data.baseStatistics;
                    var series = new Array();
                    for(key in baseStatistics){
                        console.log("属性：" + key + ",值："+ baseStatistics[key]);
                        var values = new Array();
                        $(baseStatistics[key]).each(function (index,item) {
                            values.push(item.value);
                        })
                        series.push({'name':key,'type':'line','smooth':true,'data':values});
                    }
                    elementChart('supplierOrder',legendList,xAxis,series,"原材料",'统计趋势');
                }else{
                    alert(data.msg);
                }
            }
        });

    }

    function statisticsSaleOrders() {

        $.ajax({
            url:"/admin/statistics/statisticsSaleOrders.do",
            data:{},
            dataType:'json',
            type:'post',
            success:function(data){

                if(data.success){
                    var   xAxis = data.data.xAxis;
                    var  legendList = data.data.legendList;
                    var baseStatistics = data.data.baseStatistics;
                    var series = new Array();
                    for(key in baseStatistics){
                        console.log("属性：" + key + ",值："+ baseStatistics[key]);
                        var values = new Array();
                        $(baseStatistics[key]).each(function (index,item) {
                            values.push(item.value);
                        })
                        series.push({'name':key,'type':'line','smooth':true,'data':values});
                    }
                    elementChart('saleOrder',legendList,xAxis,series,"销售单","统计趋势");
                }else{
                    alert(data.msg);
                }
            }
        });

    }
    function companyPieStatistics() {
        $.ajax({
            url:"/admin/statisticsCompany.do",
            data:{},
            dataType:'json',
            type:'post',
            success:function(data){

                if(data.success){
                    var option = {
                        title : {
                            text: '公司统计',
                            subtext: '公司类型',
                            x:'center'
                        },
                        tooltip : {
                            trigger: 'item',
                            formatter: "{a} <br/>{b} : {c} ({d}%)"
                        },
                        legend: {
                            orient: 'vertical',
                            left: 'left',
                            data: ['生产企业','运输企业','采购企业']
                        },
                        series : [
                            {
                                name: '访问来源',
                                type: 'pie',
                                radius : '55%',
                                center: ['50%', '60%'],
                                data:[
                                    {value:data.data.count, name:'生产企业'},
                                    {value:data.data.buyCount, name:'运输企业'},
                                    {value:data.data.transCount, name:'采购企业'}
                                ],
                                itemStyle: {
                                    emphasis: {
                                        shadowBlur: 10,
                                        shadowOffsetX: 0,
                                        shadowColor: 'rgba(0, 0, 0, 0.5)'
                                    }
                                }
                            }
                        ]
                    };
                    var myChart = echarts.init(document.getElementById("companyPie"));
                    myChart.setOption(option);
                }else{
                    alert(data.msg);
                }
            }
        });
    }
    function elementChart(elementId,legendList,xAxis,series,title,subtext) {
        var myChart = echarts.init(document.getElementById(elementId));
        var  option = {
            title : {
                text: title,
                subtext: subtext
            },
            tooltip : {
                trigger: 'axis'
            },
            legend: {
                data:legendList
            },
            toolbox: {
                show : false,
                feature : {
                    mark : {show: true},
                    dataView : {show: true, readOnly: false},
                    magicType : {show: true, type: ['line', 'bar', 'stack', 'tiled']},
                    restore : {show: true},
                    saveAsImage : {show: true}
                }
            },
            calculable : true,
            xAxis : [
                {
                    type : 'category',
                    boundaryGap : false,
                    data :xAxis
                }
            ],
            yAxis : [
                {
                    type : 'value'
                }
            ],
            series : series
        };

        myChart.setOption(option);
    }
</script>
</html>
